// mmo_game_server/security/libevent_wrapper.cpp
#include "libevent_wrapper.h"

LibeventWrapper::LibeventWrapper() {
    base = event_base_new();
}

LibeventWrapper::~LibeventWrapper() {
    event_base_free(base);
}

void LibeventWrapper::Start() {
    event_base_dispatch(base);
}

void LibeventWrapper::Stop() {
    event_base_loopexit(base, nullptr);
}

void LibeventWrapper::AddEvent(struct event* ev) {
    event_add(ev, nullptr);
}